Ccay.Module.define("Ccay.example.functionDemo.ServerNode.serverNodeDemo",function(page,$S){
	/*
	 * 创建节点
	 */
	page.createServerNode=function(serverName){
		if(Ccay.DataHelper.isEmpty(serverName)){
			 Ccay.UI.topBox("serverName不能为空");
			 return;
		}
		var a=$S("#serverNode").jsonData();
		Ccay.doPost("services/ccay/web/support/cloud/single/create", 
		$S("#serverNode").jsonData(), function() {
				Ccay.UI.topBox("success");
		});
	}
	/*
	 * 删除节点
	 */
	page.deleteServerNode=function(serverName){
		if(Ccay.DataHelper.isEmpty(serverName)){
		 Ccay.UI.topBox("serverName不能为空");
			 return;
		}
		var a=$S("#serverNode1").jsonData();
		Ccay.doPost("services/ccay/web/support/cloud/server/delete", 
		{name:serverName}, function() {
				Ccay.UI.topBox("success");
		});
	}
	/*
	 * 替换节点
	 */
	page.replaceServerNode=function( serverName){
		var a=$S("#serverNode2").jsonData();
		Ccay.doGet("services/ccay/registry/single/create", 
		$S("#serverNode2").jsonData(), function() {
				Ccay.Component.Excel.exportCallback();
		});
	}
	
	function saveData(data){
			var batchVO = new Object();
			batchVO.items2Create = data;
		    Ccay.doPut("services/ccay/edm/edoc/batch",batchVO,function(){
		   	    Ccay.UI.topBox($i18n("ccay.common.message.success"));
			},function(){
			}); 
		}
});




